﻿-- CanView = 1
-- CanEdit = 2
-- CanSubmit = 4
-- CanApprove = 8
-- CanReject = 16
-- Admin = 31
-- Contributor = 7
SELECT Utilities.ReadBit(31, 8) -- 1 : Admin has CanApprove
SELECT Utilities.ReadBit(31, 2) -- 1 : Admin has CanEdit
SELECT Utilities.IsBitUnion(31, 10) -- 1 : Admin has CanApprove & CanEdit
SELECT Utilities.ReadBit(7, 8) -- 0 : Contributor does not have CanApprove
SELECT Utilities.ReadBit(7, 2) -- 1 : Contributor has CanEdit
SELECT Utilities.IsBitUnion(7, 10) -- 0 : Contributor does not have CanApprove & CanEdit
SELECT Utilities.SetBit(7, 8, 1) -- 15 : Add CanApprove to Contributor
SELECT Utilities.ReadBit(15, 8) -- 1 : Contributor has CanApprove
SELECT Utilities.IsBitUnion(15, 10) -- 1 : Contributor has CanApprove & CanEdit